package com.maleant.mvvm.basemvvm.ui;

import android.os.Bundle;
import android.os.PersistableBundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;

import com.maleant.mvvm.basemvvm.R;
import com.maleant.mvvm.basemvvm.model.Product;
import com.maleant.mvvm.basemvvm.ui.fragment.ProductFragment;
import com.maleant.mvvm.basemvvm.ui.fragment.ProductListFragment;

/**
 * Created by ant on 17-12-20.
 */

public class MainActivity extends AppCompatActivity {

    @Override
    public void onCreate(@Nullable Bundle savedInstanceState, @Nullable PersistableBundle persistentState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.activity_main);

        if (savedInstanceState == null) {
            ProductListFragment fragment = new ProductListFragment();

            getSupportFragmentManager().beginTransaction()
                    .add(R.id.fragment_container, fragment, ProductListFragment.TAG).commit();
        }

    }

    public void show(Product product) {
//        ProductFragment productFragment = ProductFragment.for
    }
}
